perm filename A2E.KK[S,DOC]3 blob sn#046521 filedate 1973-06-01 generic text, type T, neo UTF8
UNIVERSITY OF UTAH COMPUTATIONAL PHYSICS GROUP           January 1973
REPORT NO. UCP-6

STANFORD ARTIFICIAL INTELLIGENCE LABORATORY          
OPERATING NOTE 64.1














                                 A2E


     STANFORD AI PDP-10 ASCII TO EBCDIC CODE CONVERSION PROGRAM*



                                 by


                              Kevin Kay

                         University of Utah

















*This research was sponsored by the Advanced Research Projects Agency
of  the  Office  of  the  Department  of  Defense  under Contract No.
F30602-70-C-0300 at the University of Utah.

1. INTRODUCTION

	A2E  is a program for transferring files from the Stanford AI
PDP-10 to an IBM 360 Series machines. It will transfer files  written
in  ASCII from the PDP-10 to the System/360 and EBCDIC files from the
System/360 to the PDP-10 .


2. NOTES ON THE PROGRAM

1)  Common  ASCII characters with no EBCDIC equivalent are translated
as follows:

	ASCII	EBCDIC

	↑	?
	\	<space>
	[	<
	]	>

On translation back to ASCII, ?,<sp>,< and > will  remain  unchanged,
of course.
	Vertical tabs are ignored, and horizontal tabs  are  replaced
by blanks, assuming eight spaces per tab.

2)  The  program  uses the 7 track convert option of the System /360.
Thus three 8-bit EBCDIC characters are written on the  tape  as  four
six-bit  characters.   In  order to remain compatible with the PDP-10
hardware, the number of characters on each tape record must therefore
be  divisible  by nine. For this reason, the program writes and reads
81 characters per record on the magnetic tape.

3) If an SOS file is written on tape, the page number  appears  as  a
sequence  number  in  columns  73-75  and  the line number in columns
76-80. Column 81 is blank.

4) The program assumes that the ASCII file  is  on  the  user's  disk
area,  and  that the magnetic tape is on MTA0. These devices could be
changed by an assignment statement such as

.AS MTA1 MTA0

4) If an ASCII form feed is encountered on input, the program assumes
an  end of page, and fills up the output file with blank lines to the
end of the page, assuming 59 lines per page.

5) If an input ASCII line is longer than 72 characters, the remaining
characters will be written in the next tape record, with asterisks in
columns 73-80.


3. INSTRUCTIONS FOR MOVING ASCII FILES TO THE SYSTEM/360


a) Mount a magnetic tape on MTA0, write enabled.

b) Rewind the tape.

c) Run the program A2E as in the following prototype example.

.R A2E

INPUT CODE:   A<cr>
    FILE NAME:  JOE<cr>

*** TAPE CONTROL SECTION ***

* S<cr>

*↑C

.

	The  tape  control  section  allows  users   all   the   tape
positioning  options  of  PIP.   For a full description of the use of
this section, the DEC documentation on the CODE program, of which A2E
is an adaptation, should be consulted.


d) Take the tape to the System/360 Computer  and  run  the  following
prototype program:

//A2E JOB  <jobcard>
/* SETUP T,'PLEASE MOUNT TAPE U000 ON 0C0, READ ONLY'
// EXEC PGM=IEHMOVE
//SYSPRINT DD SYSOUT=A
//SYSUT1 DD UNIT=2314,VOL=SER=SYS03,DISP=OLD
//TAPE DD UNIT=TAPE7,DISP=(OLD,PASS),LABEL=(,BLP),VOL=SER=TAPE,
//        DCB=(DEN=1,TRTCH=C,RECFM=F,LRECL=81)
//SYS15 DD UNIT=2314,DISP=OLD,VOL=SER=SYS15
//SYSIN DD *
 COPY DSNAME=A123.BILL,FROM=0C0=(TAPE,1),TO=2314=SYS15,FROMDD=TAPE
/*

	The above SETUP statement is peculiar to the Stanford 360/67.
In addition, the disk volume and the file-name specification must  be
altered as required.

	If you are using the Stanford  360/67,  you  will  find  that
TAPEDUMP  is  cheaper  to  use  than IEHMOVE. You should also use the
FUTILITY partition overnight if you can wait that long.  However, the
JCL  will  have to be modified to use this partition. (See the Campus
Facility BULLETIN, Vol VII, No 8 for details).

A prototype TAPEDUMP job to do the same thing would be as follows:
//A2E JOB  <jobcard>
/* SETUP T,'PLEASE MOUNT TAPE U000 ON 7 TRACK, READ ONLY'
// EXEC TAPEDUMP
//GO.TWO DD UNIT=TAPE7,DCB=(DEN=1,TRTCH=C)
//GO.FT11F001 DD DCB=(LRECL=81,BLKSIZE=1620),DISP=(,KEEP),
//        VOL=SER=SYS15,DSN=A123.BILL
//GO.SYSIN DD *
 &PARMS DUMP=F,DISK=T,LDISK=81 &END
/*


e) Using WYLBUR, load the file as follows:

USE BILL LRECL=81 ON SYS15 
SET LENGTH=80 


At this point, you have a regular WYLBUR data set and can do what you
like with it  (e.g.,  print,  punch,  etc).  However,  it  still  has
sequence numbers in columns 73/80. to remove these, say, in WYLBUR,

CH 73/80 TO '' IN ALL NOLIST

	To gain the full advantage of the conversion, you may wish to
specify the upper and lower case chain for printing.


4. INSTRUCTIONS FOR MOVING EBCDIC FILES TO THE PDP-10.

a) Using WYLBUR, save the file as follows:

SAVE JOE ON SYS15 LRECL=81(1)


b) Run the following program:

//E2A JOB  <jobcard>
/* SETUP T,'PLEASE MOUNT TAPE U000 ON 0C0, WRITE ENABLE'
// EXEC PGM=IEHMOVE
//SYSPRINT DD SYSOUT=A
//SYSUT1 DD UNIT=2314,VOL=SER=SYS03,DISP=OLD
//TAPE DD UNIT=TAPE7,DISP=(OLD,PASS),LABEL=(,BLP),VOL=SER=TAPE,
//        DCB=(DEN=1,TRTCH=C,RECFM=F,LRECL=81)
//SYS15 DD UNIT=2314,DISP=OLD,VOL=SER=SYS15
//SYSIN DD *
 COPY DSNAME=A123.JOE,FROM=2314=SYS15,TO=0C0=(TAPE,1),TODD=TAPE
/*


The F partition can also be used for this job, of course.

c) Mount the tape on MTA0 at the AI Project.

d) Rewind the tape.

e) Run the program A2E as in the following prototype example:

.R A2E

INPUT CODE:   E<cr>

OUTPUT FILE NAME:  XYZ<cr>

*** TAPE CONTROL SECTION ***

*S<cr>

*


f) If your input file had sequence  numbers  in  columns  73/80,  you
would  now probably want to remove them with the E switch in PIP. You
should also use the C switch to suppress trailing blanks and  convert
multiple spaces to tabs.

5. Reporting of Errors and Suggestions for Improvement.

	These should be recorded in the Stanford AI PDP-10  by  means
of the command SEND ACH.